package com.qingke.notlonely.command.system;

import java.util.List;

import com.qingke.notlonely.bean.User;
import com.qingke.notlonely.command.SystemCommand;
import com.qingke.notlonely.util.NLConsole;

public class ListUserByGenderAndMostBeInvited extends SystemCommand{

	@Override
	public void execute() {
		String gender="Ů";
		List<?> list=dao.selectUserByBeInvitedTimes();
		long maxTimes=0;
		for(Object o:list){
			User user=(User) ((Object[])o)[0];
			if(user.getGender().equals(gender)){
				maxTimes=Math.max(maxTimes,(long) ((Object[])o)[1]);
				if(maxTimes!=(long) ((Object[])o)[1])
					continue;
				NLConsole.println(user);
				NLConsole.println("times:"+maxTimes);
			}
		}
	}

}
